<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<header>
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false"><span
                        class="sr-only">切换导航</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span
                        class="icon-bar"></span></button>
                <a class="navbar-brand" href="/">YlsatCMS</a></div>
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="">消息 <span class="badge">1</span></a></li>
                    <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" role="button"
                                            aria-haspopup="true" aria-expanded="false">admin <span class="caret"></span></a>
                        <ul class="dropdown-menu dropdown-menu-left">
                            <li><a title="查看或修改个人信息" data-toggle="modal" data-target="#seeUserInfo">个人信息</a></li>
                            <li><a title="查看您的登录记录" data-toggle="modal" data-target="#seeUserLoginlog">登录记录</a></li>
                        </ul>
                    </li>
                    <li><a href="/Index/outLogin" onClick="if(!confirm('是否确认退出？'))return false;">退出登录</a></li>
                    <li><a data-toggle="modal" data-target="#WeChat">帮助</a></li>
                </ul>
                <form action="" method="post" class="navbar-form navbar-right" role="search">
                    <div class="input-group">
                        <input type="text" class="form-control" autocomplete="off" placeholder="键入关键字搜索" maxlength="15">
                        <span class="input-group-btn">
              <button class="btn btn-default" type="submit">搜索</button>
              </span></div>
                </form>
            </div>
        </div>
    </nav>
</header>
<script>
    window.alert = alert;
    function alert(data) {
        var a = document.createElement("div"),
            p = document.createElement("p"),
            btn = document.createElement("div"),
            textNode = document.createTextNode(data ? data : ""),
            btnText = document.createTextNode("确定");
// 控制样式
        css(a, {
            "position": "fixed",
            "left": "0",
            "right": "0",
            "top": "40%",
            "width": "300px",
            "margin": "0 auto",
            "padding": "10px",
            "color": "#FF5050",
            "background-color": "#fff",
            "border": "1px solid #FF5050",
            "border-radius": "4px",
            "font-size": "14px",
            "text-align": "center",
            "z-index": "10"
        });

        css(btn, {
            "width": "80px",
            "margin": "0 auto",
            "margin-top": "20px",
            "line-height": "24px",
            "color": "#fff",
            "background": "#FF5050",
            "border-radius": "4px",
            "cursor": "pointer"
        });

// 内部结构套入
        p.appendChild(textNode);
        btn.appendChild(btnText);
        a.appendChild(p);
        a.appendChild(btn);
// 整体显示到页面内
        document.getElementsByTagName("body")[0].appendChild(a);
// 确定绑定点击事件删除标签
        btn.onclick = function () {
            a.parentNode.removeChild(a);
        };
    }

    function css(targetObj, cssObj) {
        var str = targetObj.getAttribute("style") ? targetObj.getAttribute("style") : "";
        for (var i in cssObj) {
            str += i + ":" + cssObj[i] + ";";
        }
        targetObj.style.cssText = str;
    }


    //去掉alert域名显示
    (function(){
        window.alert = function(name){
            var iframe = document.createElement("IFRAME");
            iframe.style.display="none";
            iframe.setAttribute("src", 'data:text/plain');
            document.documentElement.appendChild(iframe);
            window.frames[0].window.alert(name);
            iframe.parentNode.removeChild(iframe);
        }
    })();


</script>